package com.zbc.config;

import com.zbc.interceptor.AuthVerifyAdminInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {

    @Autowired
    private AuthVerifyAdminInterceptor authVerifyAdminInterceptor;

    protected void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(authVerifyAdminInterceptor)
                .addPathPatterns("/admin/**")
                .excludePathPatterns("/admin/employee/login");
    }
}
